﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %>
    <!-- Start Search -->
    <div class="title"><span class="title_icon"><img src="/content/images/bullet3.gif" alt="" title="" /></span>Tìm Kiếm</div> 
    <div class="about" style = "height:60px;">
        <form name="search" id="func" action="/book/search" method = "get">
        <span> Tên Sách : </span>
			<input type = "text" value="" name="title" id="key" style="margin-left:5px;width:185px" maxlength="32">
			<a href="javascript:;" onclick="search_book();" class="contact" > Tìm </a>
			<div style="clear:both"></div>
			<a href = "/book/search" style="float:right;margin-top:15px;">Tìm Kiếm Nâng Cao</a>
		</form>
      </div>
    <!-- End Search -->         
     
    <!-- Start Cart -->           
    <div class="cart" style="height:auto !important;" id="gio_hang">
        <div class="title"><span class="title_icon"><img src="/content/images/cart.gif" alt="" title="" /></span>Giỏ Hàng</div>
        <% Boolean check = false; %>
        <div id="buybook">
        <% string[] buy = (string[])ViewData["buy"];  %>
        <% if (buy != null && buy.Length > 0 && buy[0] != "0")
           { check = true;%>
            <div style="clear:both;"></div>
            <div class="home_cart_content">
             Mua : <%= buy[0] %> x cuốn | <span class="red"><%= buy[1] %> VNĐ</span>
            </div>
            <a href="/cart/buy" class="view_cart">Giỏ hàng</a>
        <% } %>
        </div>
        <div id="rentbook">
        <% string[] rent = (string[])ViewData["rent"];  %>
        <% if (rent != null && rent.Length > 0 && rent[0] != "0")
           { check = true;%>
            <div style="clear:both;"></div>
            <div class="home_cart_content">
             Thuê : <%= rent[0] %> x cuốn | <span class="red"><%= rent[1] %> VNĐ</span>
            </div>
            <a href="/cart/rent" class="view_cart">Giỏ hàng</a>
        <% } %>
        </div> 
        <div id="err">
        <%if (check == false){%>
            <div style="clear:both;"></div>
            <div align="center" style="margin-bottom:10px;">Không có sách nào trong giỏ hàng.</div>
        <%} %>
        </div>       
    </div>
    <!-- End Cart -->
    
    <!-- Start profile -->
     <% if(Session["Session_User"]!=null) { %>
     <div class="title"><span class="title_icon"><img src="/content/images/bullet3.gif" alt="" title=""></span>Quản Lý Tài Khoản</div>
    
     <div class="about" style="margin-left:0;">
                    <span style="font-size:13px;margin-left:50px;"> <b><i>Chào,</i> <u><%= ViewData["user_name"] %></u></b></span><br><br>
					<span style=" font-size:13px;font-style:italic;margin-left:50px;"> Thông Tin Tài Khoản</span><br>
					<span style="margin-left:80px;">*<a href="/account/edituser" style="margin-left:5px;">  Sửa Thông Tin Tài Khoản</a></span><br>
					<span style="margin-left:80px;">*<a href="/account/changepassword" style="margin-left:5px;"> Thay Đổi Mật Khẩu</a></span><br><br>
					<span style="font-size:13px;font-style:italic;margin-left:50px;"> Lịch Sử Đặt Hàng </span><br>
					<span style="margin-left:80px;">*<a href="/cart/historyorder" style="margin-left:5px;">  Xem Lịch Sử Đặt Hàng</a></span><br><br>
					<span style="font-size:13px;font-style:italic;margin-left:50px;"> Sách Ưu Thích </span><br>
					<span style="margin-left:80px;">*<a href="/book/favoritebook" style="margin-left:5px;">  Xem Sách Ưu Thích</a></span>	   
     </div>
     <% } %>
     <div style="clear:both;"></div>
     <!-- End Profile -->
     
    <!-- Start SAbout -->
    <% string[] about = (string[])ViewData["about"]; %>
    <% if (about != null && about.Length > 0)
       { %>    
    <div class="title"><span class="title_icon"><img src="/content/images/bullet3.gif" alt="" title="" /></span>Thông Tin Cửa Hàng</div> 
    <div class="about">
    <%= about[1] %>
    </div>
    <%} %>
    <!-- End About -->
    
    <!-- Start Best Seller -->         
    <div class="right_box">
    <div class="title"><span class="title_icon"><img src="/content/images/bullet4.gif" alt="" title="" /></span>Sách Bán Chạy</div> 
    <% string[][] seller = (string[][])ViewData["seller"]; %>
	<% if (seller != null && seller.Length > 0)
    {%>
    <% foreach (string[] row in seller)
    { %>
      <% if (row != null)
         {%>     
            <div class="new_prod_box">
                 <a href="/book/detail?id=<%= row[6] %>"><%= row[1] %></a>
                 <div class="new_prod_bg">
                 <a href="/book/detail?id=<%= row[6] %>"><img src="<%= row[7] %>" onerror=this.src='/content/images/no_image.jpg' width="60" height="90" alt="" title="" class="thumb" border="0" /></a>
             </div>           
             </div>
         <%}
      }%>
     <%}
    else
    { %>
    <div align="center">Không có sách bán chạy !</div>
     <%} %>              
    </div>
     <!-- End Best Seller -->
     
     <!-- Start Categories -->        
    <div class="right_box">
    <div class="title"><span class="title_icon"><img src="/content/images/bullet5.gif" alt="" title="" /></span>Thể Loại Sách</div> 
     <ul class="list">
        <% string[][] category = (string[][])ViewData["category"]; %>
	    <% if (category != null && category.Length > 0)
        {%>
       <% foreach (string[] row in category)
          { %>
         <% if (row != null)
            {%>         
         <li><a href="/book/category?id=<%= row[0] %>"><%= row[1] %></a></li>
       <%}
          }
        } %>
     </ul>
     </div>  
    <!-- End Categories -->
